package br.ufrn.engcomp.domain;

import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import br.ufrn.engcomp.arq.PersistDB;

@Entity
@Table(schema = "public", name = "userr")
public class User implements PersistDB {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_seq")
    @SequenceGenerator(name = "user_seq", sequenceName = "id_user", allocationSize = 0)
    @Column(name = "userr_id")
    private int id;

    private String login;

    private String name;

    private String passwd;

    private String email;

    private String role;

    @OneToMany(mappedBy = "userr", cascade = CascadeType.ALL)
    private Collection<Experiment> experiments;

    public int getId() {
	return id;
    }

    public void setId(int id) {
	this.id = id;
    }

    public String getLogin() {
	return login;
    }

    public void setLogin(String login) {
	this.login = login;
    }

    public String getPasswd() {
	return passwd;
    }

    public void setPasswd(String passwd) {
	this.passwd = passwd;
    }

    public String getEmail() {
	return email;
    }

    public void setEmail(String email) {
	this.email = email;
    }

    public String getRole() {
	return role;
    }

    public void setRole(String role) {
	this.role = role;
    }

    public Collection<Experiment> getExperiments() {
	return experiments;
    }

    public void setExperiments(Collection<Experiment> experiments) {
	this.experiments = experiments;
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

}
